package com.team11.server.service.admin;

import com.team11.server.mapper.Admin_InsertSInSk_Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class Admin_InsertSInKc_Service {
    @Autowired
    private Admin_InsertSInSk_Mapper admin_insertSInSk_mapper;
    public String insertSInSk(HashMap<String,Object> map){
        Integer t=admin_insertSInSk_mapper.InsertSInSk(map);
        if (t>0){
            return "新增成功";
        }
        else return "新增失败";

    }
    public String selSInKc(HashMap<String,Object> map){
        Integer t=admin_insertSInSk_mapper.SelSInSk(map);
        if (t>0){
            return "学生已在该课程";
        }
        else return "1";
    }
    public String selHaveS(String sNumber){
        Integer t=admin_insertSInSk_mapper.SelHaveS(sNumber);
        if (t>0){
            return "1";
        }
        else return "该学生不存在";
    }
    //判断学生是否存在考勤表
    public Integer SelHaveSInKq(HashMap<String,Object> map){
        return admin_insertSInSk_mapper.SelHaveSInKq(map);
    }
    //课程选择学生插入考勤表
    public void InsertSInKq(HashMap<String,Object> map){
        admin_insertSInSk_mapper.InsertSkq(map);
    }
}
